package com.zimmor.redis.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Author:zimmor
 * @Date: 2021/7/4 16:39
 * @Description
 * @version: 1.0.0
 */
@Service
public class RedisService {
    @Autowired
    private RedisTemplate<String, String> redisTemplate;
    public void test() {
        ValueOperations valueOperations = redisTemplate.opsForValue();
        valueOperations.set("name", "Spring");
        Object name = valueOperations.get("name");
        System.out.println("name = " + name);
    }
}
